<template>
  <!-- 方案规划导航栏 -->
  <div style="border: 1px solid #6979ebba;border-radius: 8px;margin-top: 2.5%;width: 99%;height: 82vh;float: left;position: absolute;">
    <!-- 顶部tab切换 -->
    <div style="margin-left: 1vh;margin-right: 1vh;top: 1%; width: 99%;height: 8vh;float: left;position: absolute;">

      <div id="htpdDiv1" @click="buttonClick('htSchemeSelection', 'htpdDiv1')" style="background:#409EFF" class="buttonStyle">方案选型</div>
      <div id="htpdDiv2" @click="buttonClick('supplyDemandInfo', 'htpdDiv2')" class="buttonStyle">供需信息</div>
      <div id="htpdDiv3" @click="buttonClick('htpdAnalogComputation', 'htpdDiv3')" class="buttonStyle">模拟计算</div>
      <div id="htpdDiv4" @click="buttonClick('planningResults', 'htpdDiv4')" class="buttonStyle">规划结果</div> 
      <div id="htpdDiv5" @click="buttonClick('htpdCostBreakdown', 'htpdDiv5')" class="buttonStyle">成本明细</div>
 
    </div>

    <div id="routerDiv" class="divBox1">
      <!--路由页面-->
      <router-view :key="activeDate"></router-view>
    </div>
     

  </div>
</template>

<script>
  export default {
    name: 'hydrogenTransmissionPlanDesign',
    data() {
      return {
        windowDatate: '',
        activeDate: '',
        schemeId:"",
        type: '',
        projectId : ""
      }
    },
    mounted: function() {
      //获取项目id
      this.projectId = this.$route.query.projectId;
      //路由跳转
      this.activeDate = new Date().getTime();

      this.$router.push({path:'/htSchemeSelection',query:{"projectId":this.projectId}})

    },
    methods: {
      buttonClick : function(type,divId){
        
        if(type=="htpdCostBreakdown"){
          $("#routerDiv").attr("class","divBox2");
        }else{
          $("#routerDiv").attr("class","divBox1");
        }

        for(var i = 1;i<=5;i++){
          $("#htpdDiv"+i).css("background","#1f2c6c3b");
        }
        $("#"+divId).css("background","#409EFF");
        this.activeDate = new Date().getTime();

        //路由跳转
        this.$router.push({path:'/'+type,query:{"schemeId":this.schemeId,"projectId":this.projectId}})

      }, 
 
    }
  }
</script>

<style scoped>
  .buttonStyle {
    height: 4vh;
    width: 20vh;
    display: inline-block;
    -webkit-border-radius: 60px;
    -moz-border-radius: 60px;
    cursor: pointer;
    border-radius: 10px;
    font-family: Arial;
    border: none;
    color: #ffffff;
    font-size: 1.6vh;
    background: #1f2c6c3b;
    border-bottom: 1px solid rgb(64, 158, 255);
    margin: 1.5vh 10px;
    text-align: center;
    line-height: 4vh;
    vertical-align: middle;
    text-decoration: none;
  }

  
  .divBox1{
    margin: 9vh auto;
    width: 98%;
    height: 71vh;
    border: 1px solid rgba(105, 121, 235, 0.73);
    border-radius: 8px;
  }
  .divBox2{
    margin: 9vh auto;
    width: 97.8%;
    left: 2vh;
    height: 71vh;
    overflow-y: auto;
    position: absolute;
    border: 1px solid rgba(105, 121, 235, 0.73);
    border-radius: 8px;
  }


</style>
